package org.example.springbootdemo02.service.impl;

import org.example.springbootdemo02.mapper.AccountMapper;
import org.example.springbootdemo02.pojo.Account;
import org.example.springbootdemo02.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountMapper accountMapper;
    /**
     * 查询所有账户
     *
     * @return
     */
    @Override
    public List<Account> selectAll() {
        return accountMapper.selectAll();
    }

    @Override
    public void insert(Account account) {
        accountMapper.insert(account);
    }

    @Override
    public void delete(Integer id) {
        accountMapper.delete(id);
    }

    @Override
    public void update(Account account) {
        accountMapper.update(account);
    }

    @Override
    public Account selectById(Integer id) {
        return accountMapper.selectById(id);
    }

    @Override
    public Account selectByName(String name) {
        return accountMapper.selectByName(name);
    }
}
